package org.hyson.gofun;
public class PlayerFactory{
        public static Player createPlayer(int index,
        			Pieces who, int free_pieces,
        			boolean is_human, Board board, Game game){
                switch(index){
                        case 1:
                                return (Player) new HumanPlayer(who, free_pieces, is_human, board,game);
                        case 2:
                                return (Player) new ComputerPlayer(who, free_pieces, is_human, board, game);
                        case 3:
                                return (Player) new HumanPlayer(who, free_pieces, is_human, board, game);
                        default:
                                return (Player) new HumanPlayer(who, free_pieces, is_human, board, game);
                }
        }
}
